package com.lihua.newideas.service.impl;

import com.lihua.newideas.mapper.CommentMapper;
import com.lihua.newideas.pojo.Comment;
import com.lihua.newideas.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CommentServiceImpl implements CommentService {

    @Autowired
    CommentMapper commentMapper;

    @Override
    public String insertComment(Comment comment) {
        commentMapper.insertComment(comment);
        return "成功";
    }

    @Override
    public List<Comment> queryCommentByArticleId(long articleId) {
        return null;
    }

    @Override
    public String deleteCommentById(long id) {
        commentMapper.deleteCommentById(id);
        return "成功";
    }

    @Override
    public Comment queryCommentByArticleIdAndUserName(long articleId, String userName) {
        return commentMapper.queryCommentByArticleIdAndUserName(articleId,userName);
    }
}
